package com.example.server.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;


@Data
public class User {
//    @NotNull
    private Integer id;//主键id
//    @NotNull
//    @NotEmpty
//    @Pattern(regexp = "^\\S{1,10}$", message = "昵称必须为1~10个字符")
    private String username;//昵称
    private String avatar;//头像路径
//    @NotEmpty
//    @Email
    private String email;//邮箱
    @JsonIgnore
    private String password;//密码
    private LocalDateTime createTime;//创建时间
    private LocalDateTime lastLogin;//最近登录时间
    private Integer status;//活跃状态
    private String role;//登录身份
}
